import java.util.Scanner;

/**
 * @author Administrator
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: PACKAGE_NAME
 * @ClassName: Demo
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/10/3 17:50
 * @Copyright 金斗版板所有
 */
public class Demo {
    public static void main(String[] args) {
        int count = 0;
        boolean isbool = true;
        Scanner input = new Scanner(System.in);
        GuessMachine p = new GuessMachine();
        System.out.println("电视商品列表");
        GuessMachine[] guessMachines = {new GuessMachine("小米电视剧", 3399), new GuessMachine("LG电视", 5999), new GuessMachine("海信电视", 12999)};
        for (int i = 0; i < guessMachines.length; i++) {
            System.out.println(guessMachines[i].name + "\t" + guessMachines[i].money);
        }
        do {
            System.out.print("请输入你猜测的商品价格：");
            int money = input.nextInt();
            String elements = p.guess(money);
            System.out.println(elements);
            count++;
            if (count == 3) {
                isbool = false;
            }
        } while (isbool);
        System.out.println("下次努力吧！！");
    }
}
